﻿using System;

namespace YArchitech.Public.Encrypt
{
	internal abstract class LicenseChecker
	{
		public uint ProductId { get; set; }

		public string ProductName { get; set; }

		public bool LicenseValid
		{
			get
			{
				return this.m_LicenseValid;
			}
		}

		public string ErrorMessage
		{
			get
			{
				return this.m_ErrorMessage;
			}
		}

		public abstract bool GetLicense();

		public abstract bool CheckLicense();

		public abstract void ReleaseLicense();

		protected void OnLicenseError()
		{
			CmdTools.RibbonEnabled = false;
			if (this.LicenseError != null)
			{
				this.LicenseError(this, null);
			}
		}

		protected bool m_LicenseValid;

		protected string m_ErrorMessage;

		public EventHandler LicenseError;
	}
}
